<div class="container">
	<div class="bg-putih">
		<div class="jdl-page row">
			<div class="col-xs-8">
				<?php echo isset($judul)?$judul:'<font color="#ccc">Judul Belum Diberikan</font>'; ?>
			</div>			
		</div>
		<div class="clearfix"></div>
		<?php echo display_flash(); ?>
		<div class="row">
      <div class="col-xs-4">
        <div class="btn-group btn-group-sm" role="group">
          <a href="<?php echo site_url('statistik_kunjungan/excel'); ?>" class="btn btn-warning"><i class="fa fa-file-excel-o"></i>&nbsp;Unduh Excel</a>
        </div>
      </div>
      <div class="col-xs-6" style="float:right">
        <div class="input-group-3">
          <?php echo form_open('statistik_kunjungan/cari'); ?>
            <button id="btn-search" type="submit" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-search"></span></button>
            <input id="after" type="text" name="tgl_akhir" class="form-control input-sm" placeholder="Tanggal Akhir" value="<?php echo $this->session->userdata('tgl_akhir') ?>"/>                             
            <span id="frm-input">
              <input id="before" type="text" name="tgl_awal" class="form-control input-sm" placeholder="Tanggal Awal" value="<?php echo $this->session->userdata('tgl_awal') ?>"/>
            </span>
            <?php echo form_close(); ?> 
          </div>
        </div>
      </div>
				<table class="table table-striped table-hover margintop20">
					<tr>
						<th width="5%">No</th>
						<th>Tanggal</th>
						<th width="20%">Pengunjung</th>
					</tr>
					<?php
						if(count($results) > 0){
							foreach ($results as $value) {
								?>
									<tr>
										<td><?php echo $ordinal_num++ ?></td>
										<td><?php echo id_date($value['Tanggal']); ?></td>
										<td align="center"><?php echo $value['pengunjung'] ?></td>
									</tr>
								<?php
							}
						}else{
							?>
								<tr>
									<td colspan="3" align="center">Tidak Ada Data</td>
								</tr>
							<?php	
						}
					?>
				</table>
				<center style="margin-top:-30px;">
          <ul class="pagination">
            <?php echo $pagination; ?>
          </ul>
        </center>
		</div>
	</div>
</div>

<script type="text/javascript">
  $(document).ready(function(){
    $('#after, #before').datepicker({
      dateFormat: "dd/mm/yy",
      changeMonth: true,
      changeYear: true
    });
  });
</script>